package com.example.lhsama.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.lhsama.domain.Product;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Date: 2021年09月19日 15:04
 * @Author: LHSAMA
 */
@Mapper
public interface ProductMapper extends BaseMapper<Product> {

    @Select("select * from product where id in (" +
            "select product_id from orders_product where orders_id = #{id}" +
            ")")
    List<Product> findAllByOrdersId(Integer id);

}
